<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;


class WechatTempMsg extends Model
{

    protected  $table='wechat_temp_msg';

    public static  $typeConf = [
        '1'=>'申请活动通过',
        '2'=>'申请活动被拒绝',
        '3'=>'申请团队通过',
        '4'=>'申请团队拒绝',
        '5'=>'签到获取时长',
        '6'=>'管理员后台补录时长',
        '7'=>'申请时长补录通过',
        '8'=>'申请时长补录拒绝',
        '9'=>'收到站内信',
        '10'=>'提醒活动即将开始',

        //团队管理员
        '50'=>'收到活动报名',
        '51'=>'志愿者签到',
        '52'=>'志愿者申请时长补录',
        '53'=>'项目审核通过',
        '54'=>'项目审核拒绝',
        '55'=>'收到站内信',
        '56'=>'志愿者申请加入团队',

    ];

    protected  $guarded = ['id', 'created_at'];

    protected $casts = ['content'=>'array'];



    public static function add($type, $content)
    {
        $node = new WechatTempMsg();

        $node->fill(['type'=>$type, 'content'=>$content]);

        return $node->save();
    }
}
